package com.tpo.jnotes.loader.dropbox;

import com.dropbox.client2.ProgressListener;
import com.tpo.jnotes.loader.lib.dialogs.LProgressBar;

public class LDropboxProgressListener extends ProgressListener
{

    private final LProgressBar progressBar;

    public LDropboxProgressListener( LProgressBar progressBar )
    {
        this.progressBar = progressBar;
        progressBar.setVisible( true );
    }

    @Override
    public void onProgress( long arg0, long arg1 )
    {
        progressBar.setMaximum( (int)(arg1 / 1024) );
        progressBar.setValue( (int)(arg0 / 1024) );
    }

}
